﻿using RealNumbersValidator;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace RealNumbersValidatorTest
{
    [TestClass]
    public class RealNumbersValidatorTest
    {
        [TestMethod]
        [DeploymentItem("RealNumbersValidator.exe")]
        public void CheckIsValidTest()
        {
            string number = "5.32";
            bool expected = true;
            bool actual = RealNumbersValidator_Accessor.CheckIsValid(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [DeploymentItem("RealNumbersValidator.exe")]
        public void CheckIsValidZeroTest()
        {
            string number = "0";
            bool expected = true;
            bool actual = RealNumbersValidator_Accessor.CheckIsValid(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [DeploymentItem("RealNumbersValidator.exe")]
        public void CheckIsValidZeroTest2()
        {
            string number = "0.00";
            bool expected = true;
            bool actual = RealNumbersValidator_Accessor.CheckIsValid(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [DeploymentItem("RealNumbersValidator.exe")]
        public void CheckIsValidNegativeZeroTest()
        {
            string number = "-0";
            bool expected = false;
            bool actual = RealNumbersValidator_Accessor.CheckIsValid(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [DeploymentItem("RealNumbersValidator.exe")]
        public void CheckIsValidNegativeTest()
        {
            string number = "-3.4";
            bool expected = true;
            bool actual = RealNumbersValidator_Accessor.CheckIsValid(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [DeploymentItem("RealNumbersValidator.exe")]
        public void CheckIsValidDoubleZeroTest()
        {
            string number = "00";
            bool expected = false;
            bool actual = RealNumbersValidator_Accessor.CheckIsValid(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [DeploymentItem("RealNumbersValidator.exe")]
        public void CheckIsValidLeadingZeroTest()
        {
            string number = "01.34";
            bool expected = false;
            bool actual = RealNumbersValidator_Accessor.CheckIsValid(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [DeploymentItem("RealNumbersValidator.exe")]
        public void CheckIsValidDoubleMinusTest()
        {
            string number = "--5";
            bool expected = false;
            bool actual = RealNumbersValidator_Accessor.CheckIsValid(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [DeploymentItem("RealNumbersValidator.exe")]
        public void CheckIsValidPlusTest()
        {
            string number = "+5.5";
            bool expected = false;
            bool actual = RealNumbersValidator_Accessor.CheckIsValid(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [DeploymentItem("RealNumbersValidator.exe")]
        public void CheckIsValidEndingWithPointTest()
        {
            string number = "5.";
            bool expected = false;
            bool actual = RealNumbersValidator_Accessor.CheckIsValid(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [DeploymentItem("RealNumbersValidator.exe")]
        public void CheckIsValidDoublePointsTest()
        {
            string number = "5.23.45";
            bool expected = false;
            bool actual = RealNumbersValidator_Accessor.CheckIsValid(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [DeploymentItem("RealNumbersValidator.exe")]
        public void CheckIsValidStartingWithPointTest()
        {
            string number = ".5";
            bool expected = false;
            bool actual = RealNumbersValidator_Accessor.CheckIsValid(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [DeploymentItem("RealNumbersValidator.exe")]
        public void CheckIsValidCommaTest()
        {
            string number = "5,25";
            bool expected = false;
            bool actual = RealNumbersValidator_Accessor.CheckIsValid(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [DeploymentItem("RealNumbersValidator.exe")]
        public void CheckIsValidContainingLetterTest()
        {
            string number = "5s43.23";
            bool expected = false;
            bool actual = RealNumbersValidator_Accessor.CheckIsValid(number);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        [DeploymentItem("RealNumbersValidator.exe")]
        public void CheckIsValidEmptyStringTest()
        {
            string number = "";
            bool expected = false;
            bool actual = RealNumbersValidator_Accessor.CheckIsValid(number);
            Assert.AreEqual(expected, actual);
        }
    }
}
